
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>发布房源-业主个人委托出租房屋</title>
    <link rel="stylesheet" href="../../taofang/plugins/bootstrap-3.3.7-dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="../../taofang/css/home2.css">
    <link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css" rel="stylesheet">

<%--    <link href="http://cdn.bootcss.com/twitter-bootstrap/2.2.2/css/bootstrap.min.css" rel="stylesheet">--%>
<%--    <link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css" rel="stylesheet">--%>
<%--    <script src="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>--%>

<%--    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">--%>
<%--    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>--%>
<%--    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>--%>
<%--    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>--%>

</head>
<body>
<script src="../../taofang/plugins/jquery-3.4.1.js"></script>
<script src="../../taofang/plugins/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<script src="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<link rel="stylesheet" href="../../taofang/css/nav.css">


<%--<div class="container-fluid">--%>
<%--    <div class="row">--%>
<%--        <nav class="navbar navbar-inverse navbar-static-top" role="navigation">--%>
<%--            <div class="container-fluid">--%>
<%--                <div class="navbar-header">--%>
<%--                    <button type="button" class="navbar-toggle" data-toggle="collapse"--%>
<%--                            data-target="#example-navbar-collapse">--%>
<%--                        <span class="sr-only">切换导航</span>--%>
<%--                        <span class="icon-bar"></span>--%>
<%--                        <span class="icon-bar"></span>--%>
<%--                        <span class="icon-bar"></span>--%>
<%--                    </button>--%>
<%--                    <img class="h" src="../../taofang/img/logo.png" alt="加载失败">--%>
<%--                </div>--%>
<%--                <div class="collapse navbar-collapse" id="example-navbar-collapse">--%>
<%--                    <!--向左对齐-->--%>
<%--                    <ul class="nav navbar-nav navbar-left">--%>
<%--                        <li><a href="home.jsp">首页</a></li>--%>
<%--&lt;%&ndash;                        <li><a href="/taofang/agent/select.action">绑定经纪人</a></li>&ndash;%&gt;--%>
<%--                    </ul>--%>
<%--                    <form class="navbar-form navbar-left" role="search">--%>
<%--                        <div class="form-group">--%>
<%--                            <input type="text" class="form-control" placeholder="搜索经纪人">--%>
<%--                        </div>--%>
<%--                        <button type="submit" class="btn btn-default">搜索</button>--%>
<%--                    </form>--%>

<%--                    <!--向右对齐-->--%>
<%--                    <ul class="nav navbar-nav navbar-right">--%>
<%--                        <li><a href="/taofang/home/exit.action" data-toggle="modal" data-target="#myModal">安全退出</a></li>--%>
<%--                        <li class="dropdown">--%>
<%--                            <a href="../personal_homepage/tenant/TenantCentre.jsp" class="dropdown-toggle" data-toggle="dropdown">个人中心</a>--%>
<%--&lt;%&ndash;                            <ul class="dropdown-menu">&ndash;%&gt;--%>
<%--&lt;%&ndash;                                <li><a href="#">房东中心</a></li>&ndash;%&gt;--%>
<%--&lt;%&ndash;                                <li><a href="#">租客中心</a></li>&ndash;%&gt;--%>
<%--&lt;%&ndash;                                <li><a href="#">经纪人中心</a></li>&ndash;%&gt;--%>
<%--&lt;%&ndash;                            </ul>&ndash;%&gt;--%>
<%--                        </li>--%>
<%--                        <li>--%>
<%--                            <img class="head" src="../../taofang/img/zly.png" alt="加载失败">--%>
<%--                        </li>--%>
<%--                    </ul>--%>
<%--                </div>--%>
<%--            </div>--%>
<%--        </nav>--%>
<%--    </div>--%>
<%--</div>--%>

<%@ include file="../nav/headnav.jsp" %>

<div class="container-fluid" style="height: 850px;">
    <div class="row">
        <h1 style="text-align: center">免费发布出租房源</h1>
        <h4 style="color: red;text-align: center">绑定经纪人后发布才有效</h4>
        <br>
        <br>
        <br>
        <br>
        <form role="form">
            <input type="hidden" name="agentId" id="agentId" value="${agent_id}">
            <input type="hidden" name="landlordId" id="landlordId" value="${landlord.id}">
            <input type="hidden" name="evaluate" id="evaluate" value="房屋评价">
            <input type="hidden" name="state" id="state" value=待出租">
            <input type="hidden" name="rent" id="rent" value="合租">
<%--            <input type="hidden" name="tendency" id="tendency" value="<% new Date();%>">--%>
<%--            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">--%>
<%--                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">--%>
<%--                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">--%>
<%--                        <span class="red">*</span>--%>
<%--                        租房类型--%>
<%--                    </span>--%>
<%--                </div>--%>
<%--                <div class="col-sm-9 col-md-7" style="height: 34px">--%>
<%--                    <label class="radio-inline" style="float: left;line-height: 34px;font-size: medium"><input type="radio" name="rent" id="rent1" style="margin-top: 11px" checked >整租</label>--%>
<%--                    <label class="radio-inline" style="float: left;line-height: 34px;font-size: medium"><input type="radio" name="rent" id="rent2" style="margin-top: 11px">合租</label>--%>
<%--                </div>--%>
<%--            </div>--%>
<%--            <br>--%>
<%--            <br>--%>
<%--            <br>--%>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        所在地域
                    </span>
                </div>
                <div class="col-sm-12 col-md-6" style="height: 34px">
                    <div style="float: left;width: 30%;">
                        <select name="input_area" id="input_city" class="form-control">
                            <option value="">姑苏区</option>
                            <option value="">虎丘区</option>
                            <option value="">吴中区</option>
                            <option value="">相城区</option>
                            <option value="">吴江区</option>
                            <option value="">常熟市</option>
                            <option value="">昆山市</option>
                            <option value="">太仓市</option>
                            <option value="">工业园区</option>
                            <option value="">张家港市</option>
                        </select>
                    </div>
                </div>
            </div>
            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        户&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;型
                    </span>
                </div>
                <div class="col-sm-12 col-md-6" style="height: 34px">
                    <div style="float: left;width: 30%;">
                        <select name="input_area" id="select_type" class="form-control">
                            <option value="">小户型</option>
                            <option value="">中户型</option>
                            <option value="">大户型</option>
                        </select>
                    </div>
                </div>
            </div>
            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        建筑面积
                    </span>
                </div>
                <div class="col-sm-12 col-md-6" style="height: 34px">
                    <div style="float: left;width: 30%;">
                        <select name="input_area" id="inputArea" class="form-control">
                            <option value="">小于等于89平方米</option>
                            <option value="">大于89平方米</option>
                        </select>
                    </div>
                </div>
            </div>
            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        朝&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;向
                    </span>
                </div>
                <div class="col-sm-12 col-md-6" style="height: 34px">
                    <div style="float: left;width: 30%;">
                        <select name="input_area" id="input_direction" class="form-control">
                            <option value="">南北</option>
                            <option value="">南</option>
                            <option value="">东南</option>
                            <option value="">东</option>
                            <option value="">西南</option>
                            <option value="">北</option>
                            <option value="">西</option>
                            <option value="">东西</option>
                            <option value="">东北</option>
                            <option value="">西北</option>
                        </select>
                    </div>
                </div>
            </div>
            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        楼&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;层
                    </span>
                </div>
                <div class="col-sm-6 col-md-3" style="height: 34px">
                    <input type="text" class="col-md-3" style="line-height: 28px" name="floor" id="floor"/><span style="float: left;line-height: 34px;font-size: medium">层</span>
                </div>
            </div>
            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        租&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;金
                    </span>
                </div>
                <div class="col-sm-6 col-md-6" style="height: 34px">
                    <input type="text" id="rent_money" class="col-md-3" style="line-height: 28px"/><span style="float: left;line-height: 34px;font-size: medium">元/月</span>
                </div>
            </div>
            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        车&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位
                    </span>
                </div>
                <div class="col-sm-9 col-md-7" style="height: 34px">
                    <label class="radio-inline" style="float: left;line-height: 34px;font-size: medium"><input type="radio" name="car" id="car1" style="margin-top: 11px" checked>是</label>
                    <label class="radio-inline" style="float: left;line-height: 34px;font-size: medium"><input type="radio" name="car" id="car2" style="margin-top: 11px">否</label>
                </div>
            </div>
            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        房主要求
                    </span>
                </div>
                <div class="col-sm-6 col-md-6" style="height: 34px">
                    <div class="form-group">
                        <textarea class="form-control" rows="1" placeholder="可输入房间描述,对合租者的要求等信息" name="require" id="require"></textarea>
                    </div>
                </div>
            </div>

            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        合租要求
                    </span>
                </div>
                <div class="col-sm-6 col-md-6" style="height: 34px">

                        <div style="float: left">
                            <label class="checkbox-inline">
                                <input type="checkbox" id="box1" value="op1">租户是否稳定
                            </label>
                            <label class="checkbox-inline">
                                <input type="checkbox" id="box2" value="op2">是否单身
                            </label>
                            <label class="checkbox-inline">
                                <input type="checkbox" id="box3" value="op3">性别（选中要求男否则要求女）
                            </label>
                        </div>
                        <div style="float: left;">
                            <label class="checkbox-inline">
                                <input type="checkbox" id="box4" value="op4">作息是否正常
                            </label>
                            <label class="checkbox-inline">
                                <input type="checkbox" id="box5" value="op5">是否吸烟
                            </label>
                            <label class="checkbox-inline">
                                <input type="checkbox" id="box6" value="op6">是否允许养宠物
                            </label>
                        </div>

                </div>
            </div>


            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        房产证明
                    </span>
                </div>
                <div class="col-sm-6 col-md-6" style="height: 34px">
                    <input type="file" name="picture" id="picture" style="margin-top: 6px">
                </div>
            </div>


<%--            <br>--%>
<%--            <br>--%>
<%--            <br>--%>
<%--            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">--%>
<%--                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">--%>
<%--                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">--%>
<%--                        <span class="red">*</span>--%>
<%--                        房产证明--%>
<%--                    </span>--%>
<%--                </div>--%>
<%--                <div class="col-sm-6 col-md-6" style="height: 34px">--%>
<%--                    <input type="text" name="picture" id="picture" style="margin-top: 6px">--%>
<%--                </div>--%>
<%--            </div>--%>


<%--            <br>--%>
<%--            <br>--%>
<%--            <br>--%>
<%--            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">--%>
<%--                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">--%>
<%--                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">--%>
<%--                        <span class="red">*</span>--%>
<%--                        租&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;期--%>
<%--                    </span>--%>
<%--                </div>--%>
<%--                <div class="col-sm-6 col-md-3" style="height: 34px">--%>
<%--                    <input type="text" class="form-control" id="tendency" placeholder="请输入租期">--%>
<%--                </div>--%>
<%--            </div>--%>

            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <div class="col-sm-6 col-md-2 col-md-offset-3" style="height: 34px;">
                    <span style="font-weight: 900;font-size: 18px;line-height: 34px">
                        <span class="red">*</span>
                        租&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;期
                    </span>
                </div>
                <div class="controls input-append date form_date col-sm-6 col-md-2" data-date=""
                     data-date-format="dd MM yyyy"
                     data-link-field="appointment_date"
                     data-link-format="yyyy-mm-dd">
                    <input size="16" type="text" value="" id="tendency" readonly>
                    <span class="add-on"><i class="icon-remove"></i></span>
                    <span class="add-on"><i class="icon-th"></i></span>
                </div>
            </div>



<%--            <div class="input-append date form_datetime col-sm-12 col-md-8 col-md-offset-2 from-group" style="text-align: center">--%>
<%--                <input size="20" type="text" value="2020-01-01" readonly>--%>
<%--                <span class="add-on"><i class="icon-remove"></i></span>--%>
<%--                <span class="add-on"><i class="icon-calendar"></i></span>--%>
<%--            </div>--%>
            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <input type="checkbox" name="ck_content"/>
                <span>我已阅读并同意</span>
                <span>
                        <a href="#" target="_blank">《淘房服务协议》</a>
                        <a href="#" target="_blank">《隐私权政策》</a>
                </span>
            </div>
            <br>
            <br>
            <br>
            <div class="col-sm-12 col-md-8 col-md-offset-2 form-group" style="text-align: center">
                <button type="button" onclick="x()" class="btn btn-primary btn-lg">确认发布</button>
            </div>
        </form>
    </div>
</div>


<!--底部导航栏-->
<%@ include file="../nav/footnav.jsp" %>
<!--底部导航栏end-->







<script>

    $(function () {
        $(".form_date").datetimepicker({
            format: 'yyyy-mm-dd',
            todayBtn: true,
            maxView: 'year',
            minView: 'month'
        });
    });

    function x() {
        // let rent1 = document.getElementById("rent1").checked;
        // let rent2 = document.getElementById("rent2").checked;
        // let rent3 = document.getElementById("rent3").checked;
        // let rent4 = document.getElementById("rent4").checked;
        // let rent = ""
        // if (rent1){
        //     rent="整租"
        // }else if(rent2){
        //     rent="合租"
        // }else if (rent3){
        //     rent="学生"
        // }else if (rent4){
        //     rent="白领"
        // }
        // alert(rent)

        let city = $("#input_city option:selected").text();
        // alert(city)

        let type = $("#select_type option:selected").text();
        //alert(type)

        let area = $("#inputArea option:selected").text();
        //alert(area)

        let direction = $("#input_direction option:selected").text();
        //alert(direction)

        let floor = $("#floor").val()
        //alert(floor)

        let car1 = document.getElementById("car1").checked;
        let car2 = document.getElementById("car2").checked;
        let car = ""
        if (car1){
            car="true"
        }else if(car2){
            car="false"
        }
        // alert(car)

        let require = $("#require").val()
        //alert(require)

        let picture = $("#picture").val()
        //alert(picture)

        let date = $("#tendency").val()
        //alert(date)

        let agentId = $("#agentId").val()

        let landlordId = $("#landlordId").val()

        let evaluate = $("#evaluate").val()

        let state = $("#state").val()

        let money = $("#rent_money").val()

        let rent = $("#rent").val()

        let box1 = document.getElementById("box1").checked;
        let box2 = document.getElementById("box2").checked;
        let box3 = document.getElementById("box3").checked;
        let box4 = document.getElementById("box4").checked;
        let box5 = document.getElementById("box5").checked;
        let box6 = document.getElementById("box6").checked;


        let cks = document.getElementsByName("ck_content");
        let count = 0;

        for (let i = 0; i < cks.length; i++) {
            if (cks[i].checked){
                count++;
            }
        }
        if (count===0){
            alert("请确认协议")

        }else {
            window.location="/taofang/post/addHouse2.action?" +
                "agentId="+agentId+"&landlordId="+landlordId+"&evaluate" +
                "="+evaluate+"&require="+require+"&picture="+picture+"&type" +
                "="+type+"&area="+area+"&floor="+floor+"&car="+car+"&date" +
                "="+date+"&direction="+direction+"&city="+city+"&rent" +
                "="+rent+"&state="+state+"&money="+money+"&box1" +
                "="+box1+"&box2="+box2+"&box3="+box3+"&box4" +
                "="+box4+"&box5="+box5+"&box6="+box6;
        }

    }



    // function checked() {
    //     let cks = document.getElementsByName("ck_content");
    //     let count = 0;
    //     let flag = true;
    //     for (let i = 0; i < cks.length; i++) {
    //         if (cks[i].checked){
    //             count++;
    //         }
    //     }
    //     if (count==0){
    //         alert("请确认协议")
    //         flag = false;
    //     }
    //     return flag;
    // }

</script>


</body>
</html>